#ifndef __MVS_SPEC_LP_H__
#define __MVS_SPEC_LP_H__

#include "mvdef.h"

MVCXX_EXTERN_BEGIN

#include "mvs_mqtt/mvs_mqtt.h"

/***********************************/
typedef struct _mqtt_tunnel_conn_args
{
    mv_v8_t    av8_url[96];        ///< 服务器主机名  [ scheme :][ // host : port]
    mv_v8ptr_t pv8_host;           ///< 指向url的host部分
    mv_u16_t   u16_scheme;         ///< 0:invalid; 1:mqtt; 2:mqtts
    mv_u16_t   u16_port;           ///< path (host:port/full_req)
}iotc_mqtt_conn_t;
/***********************************/
mv_s32_t mvs_lpmqtt_do_publish_resolve(mvs_mqtt_msg_attr_t *pattr);

/***********************************/
mv_s32_t mvspt_lpmqtt_tunnel_do_status_check(mv_void_t);

mv_s32_t mvspt_lpmqtt_tunnel_do_conn_args_update(iotc_mqtt_conn_t *pst_conn);

mv_s32_t mvspt_lpmqtt_tunnel_do_connect(mvs_mqtt_msg_attr_t *pattr, mvs_mqtt_mprop_t *pwill_props, mvs_mqtt_msg_ack_t *pack, mv_s32_t s32_timeout_ms);

mv_s32_t mvspt_lpmqtt_tunnel_do_subscribe(mvs_mqtt_msg_attr_t *pattr, mvs_mqtt_msg_ack_t *pack, mv_s32_t s32_timeout_ms);

mv_s32_t mvspt_lpmqtt_tunnel_do_publish(mvs_mqtt_msg_attr_t *pattr, mvs_mqtt_msg_ack_t *pack, mv_s32_t s32_timeout_ms);

mv_s32_t mvspt_lpmqtt_tunnel_do_disconnect(mvs_mqtt_msg_attr_t *pattr);

mv_s32_t mvspt_lpmqtt_tunnel_do_init(mv_void_t);

mv_s32_t mvspt_lpmqtt_tunnel_do_uninit(mv_void_t);

MVCXX_EXTERN_END

#endif
